package cn.wolfcode.wolf2w.common.redis.utils;

import lombok.Getter;


@Getter
//redis key的工具类
public enum RedisKeys {
    BRUSH("brush",1*60l),
    STRATEGY_THUMBSUP("strategy_thumbsup",-1L),
    STRATEGY_STATIS_HASH("strategy_statis_hash",-1L),
    STRATEGY_FAVOR("strategy_favor",-1L),
    REGIST_VERIFY_CODE("regist_verify-code",5*60L);

    private String prefix;//key的前缀
    private Long time;//过期时间

    private RedisKeys(String prefix,Long time){
        this.prefix = prefix;
        this.time = time;
    }
    //使用前缀拼接key的方法
    public String join(String... value){
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append(this.prefix);
        for (String s : value) {
            stringBuffer.append(":").append(s);
        }
        return stringBuffer.toString();
    }
}
